package yunjiao.javatutorials.designpatterns.interpreter.expr;

import yunjiao.javatutorials.designpatterns.interpreter.Employee;

/**
 * TODO
 *
 * @author yangyunjiao
 */
public class OrExpression implements Expression {
    protected Expression left;

    protected Expression right;

    public OrExpression(Expression left, Expression right) {
        super();
        this.left = left;
        this.right = right;
    }

    @Override
    public boolean interpret(Employee context) {
        return left.interpret(context) || right.interpret(context);
    }

    @Override
    public String toString() {
        return "OrExpression [left=" + left + ", right=" + right + "]";
    }
}
